'use client'
import React, { useState } from 'react'

export default function Template({children}: Readonly<{children:React.ReactNode}>) {
  // 这个count 在切换路由时会重置为初始值
  const [count, setcount] = useState(0)
  return (
    
    <div className='p-4 border-2 border-dashed border-black mt-4'>
      <h2>Dashbord Template: {count}</h2>
      <button onClick={() => setcount(count + 1)} className='bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded-md cursor-pointer my-4'>Increment</button>
      {children}
    </div>
  )
}
